{extend name="base" /} {block name="body"}
<div class="layui-body">
	<!--tab标签-->
	<div class="layui-tab layui-tab-brief">
		<ul class="layui-tab-title">
			<li class="">
				<a href="{:url('message')}">留言管理</a>
			</li>
			<li class="layui-this">审核留言</li>
		</ul>
		<div class="layui-tab-content">
			<div class="layui-tab-item layui-show">
				<form class="layui-form form-container" action="" method="post">
					<div class="layui-form-item">
						<label class="layui-form-label">留言人</label>
						<div class="layui-input-block">
							<input type="text"  readonly="readonly" value="{$message.username}" class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">留言人手机号</label>
						<div class="layui-input-block">
							<input type="text"  value="{$message.mobile}"  class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">留言时间</label>
						<div class="layui-input-block">
							<input type="text"  value="{$message.add_time}"  class="layui-input">
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">内容</label>
						<div class="layui-input-block">
							<textarea style="height: 200px;width: 100%;">{$message.content}</textarea>
						</div>
					</div>
				
					<div class="layui-form-item">
						<div class="layui-input-block">
							<input type="hidden" name="id" value="{$message.id}">
							<button type="button" onclick="sh(2)" class="layui-btn layui-btn-primary">审核通过</button>
							<button type="button" onclick="sh(1)" class="layui-btn layui-btn-primary">审核不通过</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
<script>
	// 定义全局JS变量
	var GV = {
		current_controller: "{$controller}/message"
	};
	function sh(status){
		layer.confirm('确定当前操作？', {
			btn: ['确定', '取消'] //按钮
		}, function() {
			$.ajax({
				type:"post",
				url: "{:url('admin/member/sh_message')}",
				data: {status:status,id:"{$message.id}"},//表单数据
				success: function(data) {
					layer.msg(data.msg, {
					  icon: 1,
					  time: 1500 //2秒关闭（如果不配置，默认是3秒）
					}, function(){
						  if(data.code == 200) {
								window.location="{:url('admin/member/message')}";
						  }
					}); 
				}
			})
		})
	}
</script>
{/block}